package models;

import javax.persistence.*;
import play.db.jpa.GenericModel;

@Entity
@Table(name="track")
public class Track extends GenericModel implements Comparable<Track> {
	
	@Id
	public int id;
	
//	@ManyToOne
//	@JoinColumn(name="tracklist")
//	public TrackList trackList;
	
	//cislo v trackliste
	public int position;
	
	public String name;
	
	@OneToOne
	@JoinColumn(name="artist_credit")
	public Artist artist;
	
	//dlzka v milisekundach
	public int length;
	
	//zoznam moznych videi oddeleny znakom &
	@Lob
	public String cache;
	
	@Lob
	public String blacklist;	// & oddeleny zoznam videi ktore user uznacil za nespravne

	public int compareTo(Track t) {
		return position - t.position;
	}
}
